Component({
    properties: {},
    data: {},
    methods: {
       onLoad() {
           wx.showShareMenu({
               // 要求小程序返回分享目标信息
               withShareTicket: true
           })
       },

        onShareAppMessage: function (ops) {
            if (ops.from === 'button') {
                // 来自页面内转发按钮
                console.log(ops.target)
            }
            return {
                title: '转发dom',
                path: `pages/index/index`, //分享的页面
                success: function (res) {
                    // 转发成功
                    console.log("转发成功:" + JSON.stringify(res));
                    var shareTickets = res.shareTickets;
                },
                fail: function (res) {
                    // 转发失败
                    console.log("转发失败:" + JSON.stringify(res));
                }
            }
        }
    }
});
